import config from '@/utils/config'
const uploadImg = (path, formData, callback) => {
	const url = `${config.baseUrl}/file/upload/img`
	const token = uni.getStorageSync('token')
	const header = { 'Authorization': `${token}` }
	
	uni.uploadFile({
		url, //仅为示例，非真实的接口地址
		header,
		filePath: path,
		name: 'file',
		formData,
		success: (uploadFileRes) => {
			callback(JSON.parse(uploadFileRes.data))
		}
	});
}

export default {
	uploadImg
}